<style>
/* MENIU */
	#dhtmlgoodies_menu{		
		font-family:arial;	/* Font for main menu items */
		width:150px;	/* Width of main menu */
	}
	#dhtmlgoodies_menu	li{	/* Main menu <li> */
		list-style-type:none;	/* No bullets */
		margin:0px;	/* No margin - needed for Opera */
	}
	#dhtmlgoodies_menu ul{	
		margin:0px;	/* No <ul> air */
		padding:0px;	/* No <ul> air */
	}
	#dhtmlgoodies_menu ul li ul{	/* Styling for those who doesn't have javascript enabled */
		padding-left:10px;
	}
	#dhtmlgoodies_menu	li a{	/* Main menu links */
		text-decoration:none;	/* No underline */
		color:#000;	/* Black text color */
		height:20px;	/* 20 pixel height */
		line-height:20px;	/* 20 pixel height */
		vertical-align:middle;	/* Align text in the middle */
		border:1px solid #000;	/* Black border */
		background-color:#FAFAFA;	/* Light blue background color */
		margin:1px;	/* A little bit of air */
		padding:1px;	/* Air between border and text inside */
		padding-left:3px;	/* Air between border and text inside */
		display:block;
	}
	#dhtmlgoodies_menu	li a:hover,#dhtmlgoodies_menu .activeMainMenuItem{
		color:#FFF;
		background-color:grey;
	}
	.dhtmlgoodies_subMenu{
		visibility:hidden;
		position:absolute;
		overflow:hidden;
		border:1px solid #000;
		background-color:#FAFAFA;
		font-family:arial;
		text-align:left;
	}
	.dhtmlgoodies_subMenu ul{
		margin:0px;
		padding:0px;	
	}
	.dhtmlgoodies_subMenu ul li{
		list-style-type:none;
		margin:0px;
		padding:1px;	/* 1px of air between submenu border and sub menu item - (the "white" space you see on mouse over )*/
	}
	.dhtmlgoodies_subMenu ul li a{	/* Sub menu items */
		white-space:nowrap;	/* No line break */
		text-decoration:none;	/* No underline */
		color:#000;	/* Black text color */
		height:16px;	/* 16 pixels height */
		line-height:16px;	/* 16 pixels height */
		padding:1px;	/* 1px of "air" inside */
		display:block;	/* Display as block - you shouldn't change this */
	}
	.dhtmlgoodies_subMenu ul li a:hover{	/* Sub menu items - mouse over effects */
		color:#FFF;	/* White text */
		background-color:grey;	/* Blue background */
	}
/*MENIU END*/
</style>
<script>
	/************************************************************************************************************
	(C) www.dhtmlgoodies.com, November 2005
	
	This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	
	
	Terms of use:
	You are free to use this script as long as the copyright message is kept intact. However, you may not
	redistribute, sell or repost it without our permission.
	
	Thank you!
	
	www.dhtmlgoodies.com
	Alf Magne Kalleland
	
	************************************************************************************************************/
	var timeBeforeAutoHide = 700;	// Microseconds to wait before auto hiding menu(1000 = 1 second)
	var slideSpeed_out = 10;	// Steps to move sub menu at a time ( higher = faster)
	var slideSpeed_in = 10;
		
	
	var slideTimeout_out = 25;	// Microseconds between slide steps ( lower = faster)
	var slideTimeout_in = 10;	// Microseconds between slide steps ( lower = faster)
	
	var showSubOnMouseOver = true;	// false = show sub menu on click, true = show sub menu on mouse over
	var fixedSubMenuWidth = false;	// Width of sub menu items - A number(width in pixels) or false when width should be dynamic
	
	var xOffsetSubMenu = 0; 	// Offset x-position of sub menu items - use negative value if you want the sub menu to overlap main menu
	
	var slideDirection = 'right';	// Slide to left or right ?
	
	/* Don't change anything below here */
	
	var activeSubMenuId = false;
	var activeMainMenuItem = false;
	var currentZIndex = 1000;		
	var autoHideTimer = 0;
	var submenuObjArray = new Array();
	var okToSlideInSub = new Array();
	var subPositioned = new Array();
	
	function stopAutoHide()
	{
		autoHideTimer = -1;
	}
	
	function initAutoHide()
	{
		autoHideTimer = 0;
		if(autoHideTimer>=0)autoHide();
	}
	
	function autoHide()
	{
		
		if(autoHideTimer>timeBeforeAutoHide)
		{
			
			if(activeMainMenuItem){
				activeMainMenuItem.className='';
				activeMainMenuItem = false;
			}
			
			if(activeSubMenuId){
				var obj = document.getElementById('subMenuDiv' + activeSubMenuId);
				showSub();
			}
		}else{
			if(autoHideTimer>=0){
				autoHideTimer+=50;
				setTimeout('autoHide()',50);
			}
		}
	}	
	
	function getTopPos(inputObj)
	{		
	  var returnValue = inputObj.offsetTop;
	  while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetTop;
	  return returnValue;
	}
	
	function getLeftPos(inputObj)
	{
	  var returnValue = inputObj.offsetLeft;
	  while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetLeft;
	  return returnValue;
	}
	
	function showSub()
	{
		var subObj = false;
		if(this && this.tagName){
			var numericId = this.parentNode.id.replace(/[^0-9]/g,'');
			okToSlideInSub[numericId] = false;
			var subObj = document.getElementById('subMenuDiv' + numericId);
			if(activeMainMenuItem)activeMainMenuItem.className='';
			if(subObj){
				if(!subPositioned[numericId]){
					if(slideDirection=='right'){
						subObj.style.left = getLeftPos(submenuObjArray[numericId]['parentDiv']) + submenuObjArray[numericId]['parentDiv'].offsetWidth + xOffsetSubMenu + 'px';
					}else{
						subObj.style.left = getLeftPos(submenuObjArray[numericId]['parentDiv']) + xOffsetSubMenu + 'px';
						
					}
					submenuObjArray[numericId]['left'] = subObj.style.left.replace(/[^0-9]/g,'');
					subObj.style.top = getTopPos(submenuObjArray[numericId]['parentDiv']) + 'px';
					subPositioned[numericId] = true;
				}				
				subObj.style.visibility = 'visible';
				subObj.style.zIndex = currentZIndex;
				currentZIndex++;	
				this.className='activeMainMenuItem';
				activeMainMenuItem = this;
			}
		}else{
			var numericId = activeSubMenuId;
		}
		if(activeSubMenuId && (numericId!=activeSubMenuId || !subObj))slideMenu(activeSubMenuId,(slideSpeed_in*-1));
		if(numericId!=activeSubMenuId && this && subObj){
			subObj.style.width = '0px';	
			slideMenu(numericId,slideSpeed_out);
			activeSubMenuId = numericId;
		}else{
			if(numericId!=activeSubMenuId)activeSubMenuId = false;
		}
		if(showSubOnMouseOver)stopAutoHide();
	}
	
	function slideMenu(menuIndex,speed){
		var obj = submenuObjArray[menuIndex]['divObj'];
		var obj2 = submenuObjArray[menuIndex]['ulObj'];
		var width = obj.offsetWidth + speed;
		if(speed<0){
			if(width<0)width = 0;
			obj.style.width = width + 'px';
			if(slideDirection=='left'){
				obj.style.left = submenuObjArray[menuIndex]['left'] - width + 'px';
				obj2.style.left = '0px';
			}else{
				obj2.style.left = width - submenuObjArray[menuIndex]['width'] + 'px' 
			}
			if(width>0 && okToSlideInSub[menuIndex])setTimeout('slideMenu(' + menuIndex + ',' + speed + ')',slideTimeout_in); else{
				obj.style.visibility = 'hidden';
				obj.style.width = '0px';
				if(activeSubMenuId==menuIndex)activeSubMenuId=false;
			}
			
		}else{
			if(width>submenuObjArray[menuIndex]['width'])width = submenuObjArray[menuIndex]['width'];
			if(slideDirection=='left'){
				obj.style.left = submenuObjArray[menuIndex]['left'] - width + 'px';
				obj2.style.left = '0px';
			}else{
				obj2.style.left = width - submenuObjArray[menuIndex]['width'] + 'px' 
			}		
			
			obj.style.width = width + 'px';
			if(width<submenuObjArray[menuIndex]['width']){
				setTimeout('slideMenu(' + menuIndex + ',' + speed + ')',slideTimeout_out);
			}else{
				okToSlideInSub[menuIndex] = true;
			}
		}
	}
	function resetPosition()
	{
		subPositioned.length = 0;
	}
			
	function initLeftMenu()
	{
		var isMSIE = navigator.userAgent.indexOf('MSIE')>=0?true:false;
		var browserVersion = parseInt(navigator.userAgent.replace(/.*?MSIE ([0-9]+?)[^0-9].*/g,'$1'));
		if(!browserVersion)browserVersion=1;
		
		var menuObj = document.getElementById('dhtmlgoodies_menu');	
		var mainMenuItemArray = new Array();
		
		var mainMenuItem = menuObj.getElementsByTagName('LI')[0];
		while(mainMenuItem){
			if(mainMenuItem.tagName && mainMenuItem.tagName.toLowerCase()=='li'){
				mainMenuItemArray[mainMenuItemArray.length] = mainMenuItem;
				var aTag = mainMenuItem.getElementsByTagName('A')[0];
				if(showSubOnMouseOver)
					aTag.onmouseover = showSub;	
				else
					aTag.onclick = showSub;	
			}
			mainMenuItem = mainMenuItem.nextSibling;
		}		
		
		var lis = menuObj.getElementsByTagName('A');
		for(var no=0;no<lis.length;no++){
			if(!showSubOnMouseOver)lis[no].onmouseover = stopAutoHide;
			lis[no].onmouseout = initAutoHide;
			lis[no].onmousemove = stopAutoHide;
		}
				
		for(var no=0;no<mainMenuItemArray.length;no++){
			var sub = mainMenuItemArray[no].getElementsByTagName('UL')[0];
			if(sub){
				mainMenuItemArray[no].id = 'mainMenuItem' + (no+1);
				var div = document.createElement('DIV');
				div.className='dhtmlgoodies_subMenu';
				document.body.appendChild(div);
				div.appendChild(sub);
				if(slideDirection=='right'){
					div.style.left = getLeftPos(mainMenuItemArray[no]) + mainMenuItemArray[no].offsetWidth + xOffsetSubMenu + 'px';
				}else{
					div.style.left = getLeftPos(mainMenuItemArray[no]) + xOffsetSubMenu + 'px';
				}
				div.style.top = getTopPos(mainMenuItemArray[no]) + 'px';
				div.id = 'subMenuDiv' + (no+1);
				sub.id = 'submenuUl' + (no+1);
				sub.style.position = 'relative';	
				if(navigator.userAgent.indexOf('Opera')>=0){
					submenuObjArray[no+1] = new Array();
					submenuObjArray[no+1]['parentDiv'] = mainMenuItemArray[no];
					submenuObjArray[no+1]['divObj'] = div;
					submenuObjArray[no+1]['ulObj'] = sub;
					submenuObjArray[no+1]['width'] = sub.offsetWidth;
					submenuObjArray[no+1]['left'] = div.style.left.replace(/[^0-9]/g,'');
				}
				sub.style.left = 1 - sub.offsetWidth + 'px';	

				if(browserVersion<7 && isMSIE)div.style.width = '1px';	
					
				if(navigator.userAgent.indexOf('Opera')<0){
					submenuObjArray[no+1] = new Array();
					submenuObjArray[no+1]['parentDiv'] = mainMenuItemArray[no];
					submenuObjArray[no+1]['divObj'] = div;
					submenuObjArray[no+1]['ulObj'] = sub;
					submenuObjArray[no+1]['width'] = sub.offsetWidth;
					submenuObjArray[no+1]['left'] = div.style.left.replace(/[^0-9]/g,'');
					if(fixedSubMenuWidth)submenuObjArray[no+1]['width'] = fixedSubMenuWidth;
				}	
				if(!document.all)div.style.width = '1px';			
			}			
		}
		menuObj.style.visibility = 'visible';
		window.onresize = resetPosition;
	}
	window.onload = initLeftMenu;
</script><?php
// Meniu "Atsiusti"
$meniu_atsiusti = array('Atsiųsti naujieną' => '?id,1', 'Atsiųsti pamoką' => '?id,2', 'Atsiųsti scriptą' => '?id,3', 'Atsiųsti straipsnį' => '?id,4');
// Meniu "Navigacija"
//$meniu_pagrindinis = array('MightMedia Tm' => '?id,5', 'Projektai' => '?id,6', 'Pastebin' => '?id,7', 'Nariai' => '?id,8', 'Nuorodos' => '?id,9', 'Paieška' => '?id,10');
$meniu_pagrindinis = array('Siųstis' => '?id,6', 'CodeBin' => '?id,7','Nuorodos' => '?id,9');
// Meniu "PHP Funkcijos"
$meniu_refer = array('Masyvai' => '?id,11', 'MySQL DB' => '?id,12', 'Data ir laikas' => '?id,13', 'Paveikliukai' => '?id,14', 'Matematiniai veiksmai' => '?id,15', 'Sesijos ir Sausainėliai' => '?id,16', 'Teksto formatavimas' => '?id,17', 'Kita' => '?id,18');
// Meniu "Pamokos"
$meniu_pamokos = array('mIRC' => '?id,19', 'PHP' => '?id,20', 'JavaScript' => '?id,21');
//Meniu "Forumas" ir submeniu
/*
$meniu_sql = $db->uzklausa("SELECT `id`, `pav` FROM `d_forumai` LIMIT 0 , 30");
while($row = mysql_fetch_assoc($meniu_sql)) {
	$meniu_sql1 = $db->uzklausa("SELECT `id`, `pav` FROM `d_temos` WHERE fid=".$row['id']." LIMIT 0,30");
	$meniu_forumas['<img src="images/icons/bullet2.gif" style="vertical-align: middle;" alt="o" border="0"> Pagrindinis'] = "?id,25";
	while($row1 = mysql_fetch_assoc($meniu_sql1)) {
		$meniu_forumas1[$row1['pav']] = "?id,25;t,".$row1['id'];
	}
	$meniu_forumas[$row['pav']] = $meniu_forumas1;
	unset($meniu_forumas1);
}
*/
//Meniu "Straipsniai"
$meniu_straipsniai = '';
$sql = $db->uzklausa("SELECT * FROM s_temos");
	while ($row = mysql_fetch_assoc($sql)) {
		$meniu_straipsniai[$row['pav']] = "?id,22;s," . $row['id'];
	}
/*
$meniu = array(
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> <b>Pagrindinis</b>' => $_SERVER['PHP_SELF'],
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> Navigacija' => $meniu_pagrindinis,
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> Pamokos' => $meniu_pamokos,
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> Straipsniai' => $meniu_straipsniai,
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> Forumas' => $meniu_forumas,
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> Atsiusti' => $meniu_atsiusti,
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> PHP Funkcijos' => $meniu_refer
);*/
$meniu = array(
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> <b>Pagrindinis</b>' => $_SERVER['PHP_SELF'],
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> Navigacija' => $meniu_pagrindinis,
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> Straipsniai' => $meniu_straipsniai,
'<img src="images/icons/bullet2.gif" border="0" style="vertical-align: middle;" alt="o" /> Forumas' => '?id,25'
);
$menu = th_meniu($meniu,'<div class="suckerdiv"><ul id="suckertree1">','</ul></div>');
$menu1 = '<script src="javascript/SpryMenuBar.js" type="text/javascript"></script>
<ul id="MenuBar2" class="MenuBarVertical">
    <li><a class="MenuBarItemSubmenu" href="#">Pagrindinis</a>
      <ul>
        <li><a href="?id,6">Siųstis</a></li>
            <li><a href="?id,7">CodeBin</a></li>
            <li><a href="?id,9">Nuorodos</a></li>
        </ul>
    </li>
  <li><a href="?id,25">Forumas</a></li>
    <li><a href="?id,22;s,1">Straipsniai</a></li>
</ul>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>';
$menu = '
<!--- START MENU HTML -->
<div id="dhtmlgoodies_menu">
<ul>
  <li><a href="#">New scripts</a>
    <ul>
      <li><a href="#">Slide out menu</a></li>
      <li><a href="#">Content organizer</a></li>
      <li><a href="#">Slide in pane</a></li>
      <li><a href="#">Chess widget</a></li>
      <li><a href="#">Color picker</a></li>
    </ul>
  </li>
  <li><a href="#">Updated scripts</a>
    <ul>
      <li><a href="#">Calendar script</a></li>
      <li><a href="#">Tab menu</a></li>
      <li><a href="#">DHTML menu</a></li>
      <li><a href="#">Slide in pane</a></li>
    </ul>
  </li>
  <li><a href="#">Support us</a>
    <ul>
      <li><a href="#">Link to us</a></li>
      <li><a href="#">Recommend us</a></li>
      <li><a href="#">Donate</a></li>
    </ul>
  </li>
  <li><a href="#">Forum</a>
    <ul>
      <li><a href="#">Topic one</a></li>
      <li><a href="#">Topic two</a></li>
      <li><a href="#">Topic three</a></li>
    </ul>
  </li>
  <li><a href="#">Contact us</a>
    <ul>
      <li><a href="#">Support</a></li>
      <li><a href="#">Feedback</a></li>
      <li><a href="#">Submit a script</a></li>
    </ul>
  </li>
  <li><a href="#">The end(no subs)</a></li>
</ul>
</div>
<!-- END MENU HTML-->';
lentele("Meniu",$menu);
unset($sql);
?>
